package com.ys.obj
{
	import com.ys.util.XMLUtil;
	
	import flash.media.Sound;
	import flash.media.SoundChannel;
	import flash.media.SoundTransform;
	
	public class AudioTrack
	{
		
		private var sound:Sound;
		
		private var stock:Array = [];
		
		public function AudioTrack()
		{
		}
		
		public function load(xml:XML):void
		{
			XMLUtil.loopThrougXMLData(xml, stock);
		}
		
		public function play(id:String, volume:Number=1):void
		{
			var channel:SoundChannel = new SoundChannel;
			var sound:Sound = new stock[id]();
			channel = sound.play();
			channel.soundTransform = new SoundTransform(volume);
		}
	}
}